<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录账户 - USDTMarket</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        success: '#36D399',
                        danger: '#F87272',
                        dark: '#1E293B',
                        light: '#F1F5F9',
                        'dark-blue': '#0F172A',
                        'light-blue': '#E0E7FF',
                    },
                    fontFamily: {
                        inter: ['Inter', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .scrollbar-hide {
                -ms-overflow-style: none;
                scrollbar-width: none;
            }
            .scrollbar-hide::-webkit-scrollbar {
                display: none;
            }
            .glass {
                background: rgba(255, 255, 255, 0.2);
                backdrop-filter: blur(10px);
                -webkit-backdrop-filter: blur(10px);
            }
            .card-hover {
                transition: all 0.3s ease;
            }
            .card-hover:hover {
                transform: translateY(-3px);
                box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
            }
            .login-tab.active {
                color: theme('colors.primary');
                border-color: theme('colors.primary');
            }
        }
    </style>
</head>
<body class="font-inter bg-gradient-to-br from-dark-blue to-dark min-h-screen text-light">
    <!-- 导航栏 -->
    <header class="fixed top-0 left-0 right-0 z-50 transition-all duration-300" id="navbar">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between glass border-b border-white/10">
            <div class="flex items-center space-x-2">
                <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center">
                    <i class="fa fa-exchange text-white text-xl"></i>
                </div>
                <h1 class="text-xl font-bold bg-gradient-to-r from-primary to-success bg-clip-text text-transparent">USDT<span class="text-sm font-normal ml-1">Market</span></h1>
            </div>
            
            <nav class="hidden md:flex items-center space-x-8">
                <a href="#" class="text-white/70 hover:text-primary transition-colors">首页</a>
                <a href="#" class="text-white/70 hover:text-primary transition-colors">购买USDT</a>
                <a href="#" class="text-white/70 hover:text-primary transition-colors">出售USDT</a>
                <a href="#" class="text-white/70 hover:text-primary transition-colors">交易记录</a>
                <a href="#" class="text-white/70 hover:text-primary transition-colors">账户安全</a>
            </nav>
            
            <div class="flex items-center space-x-4">
                <button class="px-4 py-2 rounded-lg bg-primary/20 text-primary hover:bg-primary/30 transition-colors font-medium flex items-center justify-center gap-2">
                    <i class="fa fa-user-circle-o mr-1"></i> 注册
                </button>
            </div>
        </div>
    </header>

    <!-- 主内容区 -->
    <main class="container mx-auto px-4 pt-24 pb-16 min-h-screen flex items-center justify-center">
        <div class="w-full max-w-md">
            <!-- 面包屑导航 -->
            <div class="mb-8 text-sm text-white/60">
                <a href="#" class="hover:text-primary transition-colors">首页</a> &gt; <span class="text-white">登录账户</span>
            </div>
            
            <div class="bg-dark-blue rounded-2xl p-8 border border-white/10 shadow-xl">
                <div class="text-center mb-8">
                    <h2 class="text-2xl font-bold mb-4">欢迎回来</h2>
                    <p class="text-white/70">请登录您的账户继续使用USDTMarket</p>
                </div>
                
                <!-- 登录方式切换 -->
                <div class="flex border-b border-white/10 mb-8">
                    <button class="login-tab active flex-1 py-3 text-center font-medium border-b-2 border-transparent transition-colors" onclick="switchLoginTab('password')">
                        密码登录
                    </button>
                    <button class="login-tab flex-1 py-3 text-center font-medium border-b-2 border-transparent transition-colors" onclick="switchLoginTab('code')">
                        验证码登录
                    </button>
                </div>
                
                <!-- 密码登录表单 -->
                <form id="password-login-form" class="space-y-6">
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="login-username">
                            用户名/手机号/邮箱
                        </label>
                        <div class="relative">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <i class="fa fa-user text-white/50"></i>
                            </div>
                            <input type="text" id="login-username" class="w-full pl-10 pr-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white" placeholder="请输入用户名/手机号/邮箱">
                        </div>
                        <p class="error-message text-danger text-sm mt-1 hidden">请输入用户名/手机号/邮箱</p>
                    </div>
                    
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="login-password">
                            密码
                        </label>
                        <div class="relative">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <i class="fa fa-lock text-white/50"></i>
                            </div>
                            <input type="password" id="login-password" class="w-full pl-10 pr-10 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white" placeholder="请输入密码">
                            <button type="button" id="toggle-login-password" class="absolute right-3 top-1/2 -translate-y-1/2 text-white/70 hover:text-white">
                                <i class="fa fa-eye-slash"></i>
                            </button>
                        </div>
                        <p class="error-message text-danger text-sm mt-1 hidden">请输入密码</p>
                    </div>
                    
                    <div class="flex justify-between items-center">
                        <div class="flex items-center">
                            <input type="checkbox" id="remember-me" class="mr-2">
                            <label for="remember-me" class="text-white/70 text-sm">记住我</label>
                        </div>
                        <a href="#" class="text-primary hover:underline text-sm">忘记密码？</a>
                    </div>
                    
                    <div>
                        <button type="submit" class="w-full px-6 py-3 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors font-medium flex items-center justify-center gap-2">
                            登录
                        </button>
                    </div>
                    
                    <div class="text-center text-white/70 text-sm">
                        还没有账户？ <a href="#" class="text-primary hover:underline">立即注册</a>
                    </div>
                </form>
                
                <!-- 验证码登录表单 -->
                <form id="code-login-form" class="space-y-6" style="display: none;">
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="login-phone">
                            手机号
                        </label>
                        <div class="relative">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <i class="fa fa-phone text-white/50"></i>
                            </div>
                            <input type="tel" id="login-phone" class="w-full pl-10 pr-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white" placeholder="请输入手机号">
                        </div>
                        <p class="error-message text-danger text-sm mt-1 hidden">请输入手机号</p>
                    </div>
                    
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="login-code">
                            验证码
                        </label>
                        <div class="relative">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <i class="fa fa-shield text-white/50"></i>
                            </div>
                            <input type="text" id="login-code" class="w-full pl-10 pr-32 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white" placeholder="请输入验证码">
                            <button type="button" id="get-code-btn" class="absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1.5 bg-primary/20 text-primary rounded-lg text-sm hover:bg-primary/30 transition-colors">
                                获取验证码
                            </button>
                        </div>
                        <p class="error-message text-danger text-sm mt-1 hidden">请输入验证码</p>
                    </div>
                    
                    <div>
                        <button type="submit" class="w-full px-6 py-3 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors font-medium flex items-center justify-center gap-2">
                            登录
                        </button>
                    </div>
                    
                    <div class="text-center text-white/70 text-sm">
                        还没有账户？ <a href="#" class="text-primary hover:underline">立即注册</a>
                    </div>
                </form>
                
                <div class="mt-8 pt-6 border-t border-white/10">
                    <h3 class="text-center text-lg font-medium mb-4">其他登录方式</h3>
                    
                    <div class="grid grid-cols-3 gap-4">
                        <button class="p-3 bg-dark rounded-lg border border-white/10 hover:bg-white/5 transition-colors flex items-center justify-center">
                            <i class="fa fa-google text-xl"></i>
                        </button>
                        <button class="p-3 bg-dark rounded-lg border border-white/10 hover:bg-white/5 transition-colors flex items-center justify-center">
                            <i class="fa fa-facebook text-xl"></i>
                        </button>
                        <button class="p-3 bg-dark rounded-lg border border-white/10 hover:bg-white/5 transition-colors flex items-center justify-center">
                            <i class="fa fa-twitter text-xl"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <!-- 页脚 -->
    <footer class="bg-dark-blue border-t border-white/10">
        <div class="container mx-auto px-4 py-12">
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
                <div>
                    <div class="flex items-center space-x-2 mb-4">
                        <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center">
                            <i class="fa fa-exchange text-white text-xl"></i>
                        </div>
                        <h2 class="text-xl font-bold bg-gradient-to-r from-primary to-success bg-clip-text text-transparent">USDT<span class="text-sm font-normal ml-1">Market</span></h2>
                    </div>
                    <p class="text-white/60 mb-4">安全、便捷的USDT交易平台，支持多种本币出售，平台担保交易，保障资金安全</p>
                    <div class="flex space-x-4">
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-twitter"></i>
                        </a>
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-telegram"></i>
                        </a>
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-discord"></i>
                        </a>
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-github"></i>
                        </a>
                    </div>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">出售服务</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">USDT出售流程</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">设置出售价格</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">添加收款方式</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">认证卖家权益</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">提现到银行卡</a></li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">资源中心</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">新手教程</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">安全指南</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">常见问题</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">交易规则</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">联系客服</a></li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">法律合规</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">隐私政策</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">服务条款</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">风险提示</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">合规声明</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">知识产权</a></li>
                    </ul>
                </div>
            </div>
            
            <div class="h-px bg-white/10 my-8"></div>
            
            <div class="flex flex-col md:flex-row justify-between items-center">
                <p class="text-white/60 text-sm mb-4 md:mb-0">© 2025 USDTMarket. 保留所有权利。平台不参与任何资金交易，仅提供信息匹配服务。</p>
                <div class="flex space-x-6">
                    <a href="#" class="text-white/60 hover:text-primary transition-colors text-sm">隐私政策</a>
                    <a href="#" class="text-white/60 hover:text-primary transition-colors text-sm">服务条款</a>
                    <a href="#" class="text-white/60 hover:text-primary transition-colors text-sm">风险提示</a>
                </div>
            </div>
        </div>
    </footer>

    <!-- JavaScript -->
    <script>
        // 导航栏滚动效果
        const navbar = document.getElementById('navbar');
        window.addEventListener('scroll', () => {
            if (window.scrollY > 10) {
                navbar.classList.add('bg-dark-blue/90');
                navbar.classList.add('shadow-lg');
            } else {
                navbar.classList.remove('bg-dark-blue/90');
                navbar.classList.remove('shadow-lg');
            }
        });
        
        // 登录方式切换
        function switchLoginTab(tab) {
            // 隐藏所有表单
            document.getElementById('password-login-form').style.display = 'none';
            document.getElementById('code-login-form').style.display = 'none';
            
            // 移除所有标签的激活状态
            document.querySelectorAll('.login-tab').forEach(tab => {
                tab.classList.remove('active');
            });
            
            // 显示选中的表单和标签
            document.getElementById(`${tab}-login-form`).style.display = 'block';
            document.querySelector(`.login-tab[onclick="switchLoginTab('${tab}')"]`).classList.add('active');
        }
        
        // 密码显示/隐藏切换
        const toggleLoginPassword = document.getElementById('toggle-login-password');
        const loginPasswordInput = document.getElementById('login-password');
        
        toggleLoginPassword.addEventListener('click', function() {
            const type = loginPasswordInput.getAttribute('type') === 'password' ? 'text' : 'password';
            loginPasswordInput.setAttribute('type', type);
            
            // 切换图标
            const icon = toggleLoginPassword.querySelector('i');
            if (type === 'password') {
                icon.classList.remove('fa-eye');
                icon.classList.add('fa-eye-slash');
            } else {
                icon.classList.remove('fa-eye-slash');
                icon.classList.add('fa-eye');
            }
        });
        
        // 验证码倒计时
        const getCodeBtn = document.getElementById('get-code-btn');
        let countdown = 60;
        
        getCodeBtn.addEventListener('click', function() {
            const phoneInput = document.getElementById('login-phone');
            const phoneValue = phoneInput.value.trim();
            
            // 验证手机号
            const phoneRegex = /^1[3-9]\d{9}$/;
            if (!phoneRegex.test(phoneValue)) {
                showError('login-phone', '请输入有效的手机号');
                return;
            }
            
            // 开始倒计时
            getCodeBtn.disabled = true;
            getCodeBtn.textContent = `${countdown}秒后重新获取`;
            
            const timer = setInterval(() => {
                countdown--;
                getCodeBtn.textContent = `${countdown}秒后重新获取`;
                
                if (countdown <= 0) {
                    clearInterval(timer);
                    getCodeBtn.disabled = false;
                    getCodeBtn.textContent = '获取验证码';
                    countdown = 60;
                }
            }, 1000);
            
            // 模拟发送验证码
            console.log('发送验证码到:', phoneValue);
        });
        
        // 显示错误信息
        function showError(fieldId, message) {
            const field = document.getElementById(fieldId);
            const errorElement = field.nextElementSibling;
            
            if (errorElement && errorElement.classList.contains('error-message')) {
                errorElement.textContent = message;
                errorElement.classList.remove('hidden');
            }
            
            field.classList.add('border-danger');
            field.classList.remove('focus:ring-primary');
            field.classList.add('focus:ring-danger');
        }
        
        // 隐藏错误信息
        function hideError(fieldId) {
            const field = document.getElementById(fieldId);
            const errorElement = field.nextElementSibling;
            
            if (errorElement && errorElement.classList.contains('error-message')) {
                errorElement.classList.add('hidden');
            }
            
            field.classList.remove('border-danger');
            field.classList.add('focus:ring-primary');
            field.classList.remove('focus:ring-danger');
        }
        
        // 表单验证 - 密码登录
        const passwordLoginForm = document.getElementById('password-login-form');
        
        passwordLoginForm.addEventListener('submit', function(e) {
            e.preventDefault();
            let isValid = true;
            
            // 验证用户名
            const username = document.getElementById('login-username').value.trim();
            if (username === '') {
                showError('login-username', '请输入用户名/手机号/邮箱');
                isValid = false;
            } else {
                hideError('login-username');
            }
            
            // 验证密码
            const password = document.getElementById('login-password').value;
            if (password === '') {
                showError('login-password', '请输入密码');
                isValid = false;
            } else {
                hideError('login-password');
            }
            
            // 如果表单有效，显示加载状态并提交
            if (isValid) {
                const submitButton = this.querySelector('button[type="submit"]');
                submitButton.disabled = true;
                submitButton.innerHTML = '<i class="fa fa-spinner fa-spin mr-2"></i> 登录中...';
                
                // 模拟API请求延迟
                setTimeout(() => {
                    // 登录成功，跳转到首页
                    alert('登录成功！');
                    window.location.href = '/';
                }, 1500);
            }
        });
        
        // 表单验证 - 验证码登录
        const codeLoginForm = document.getElementById('code-login-form');
        
        codeLoginForm.addEventListener('submit', function(e) {
            e.preventDefault();
            let isValid = true;
            
            // 验证手机号
            const phone = document.getElementById('login-phone').value.trim();
            const phoneRegex = /^1[3-9]\d{9}$/;
            if (!phoneRegex.test(phone)) {
                showError('login-phone', '请输入有效的手机号');
                isValid = false;
            } else {
                hideError('login-phone');
            }
            
            // 验证验证码
            const code = document.getElementById('login-code').value.trim();
            if (code === '') {
                showError('login-code', '请输入验证码');
                isValid = false;
            } else if (code.length !== 6) {
                showError('login-code', '验证码格式不正确');
                isValid = false;
            } else {
                hideError('login-code');
            }
            
            // 如果表单有效，显示加载状态并提交
            if (isValid) {
                const submitButton = this.querySelector('button[type="submit"]');
                submitButton.disabled = true;
                submitButton.innerHTML = '<i class="fa fa-spinner fa-spin mr-2"></i> 登录中...';
                
                // 模拟API请求延迟
                setTimeout(() => {
                    // 登录成功，跳转到首页
                    alert('登录成功！');
                    window.location.href = '/';
                }, 1500);
            }
        });
        
        // 输入字段获得焦点时隐藏错误
        document.querySelectorAll('input').forEach(input => {
            input.addEventListener('focus', function() {
                hideError(this.id);
            });
        });
    </script>
</body>
</html>    